﻿using System;
using MoonSharp.Interpreter;
using UnityEngine;

namespace Lua
{
	// Token: 0x020002FA RID: 762
	[MoonSharpUserData]
	public class Rigidbody
	{
		// Token: 0x060012B5 RID: 4789 RVA: 0x0008185F File Offset: 0x0007FA5F
		[MoonSharpHidden]
		public Rigidbody(Rigidbody rigidbody)
		{
			if (rigidbody == null)
			{
				Debug.LogError("Creating empty rigidbody");
			}
			this._rigidbody = rigidbody;
		}

		// Token: 0x170002D6 RID: 726
		// (get) Token: 0x060012B6 RID: 4790 RVA: 0x00081884 File Offset: 0x0007FA84
		// (set) Token: 0x060012B7 RID: 4791 RVA: 0x00081891 File Offset: 0x0007FA91
		public float angularDrag
		{
			get
			{
				return this._rigidbody.angularDrag;
			}
			set
			{
				this._rigidbody.angularDrag = value;
			}
		}

		// Token: 0x170002D7 RID: 727
		// (get) Token: 0x060012B8 RID: 4792 RVA: 0x0008189F File Offset: 0x0007FA9F
		// (set) Token: 0x060012B9 RID: 4793 RVA: 0x000818B1 File Offset: 0x0007FAB1
		public Vector3 angularVelocity
		{
			get
			{
				return new Vector3(this._rigidbody.angularVelocity);
			}
			set
			{
				this._rigidbody.angularVelocity = value.vector3;
			}
		}

		// Token: 0x170002D8 RID: 728
		// (get) Token: 0x060012BA RID: 4794 RVA: 0x000818C4 File Offset: 0x0007FAC4
		// (set) Token: 0x060012BB RID: 4795 RVA: 0x000818D1 File Offset: 0x0007FAD1
		public float drag
		{
			get
			{
				return this._rigidbody.drag;
			}
			set
			{
				this._rigidbody.drag = value;
			}
		}

		// Token: 0x170002D9 RID: 729
		// (get) Token: 0x060012BC RID: 4796 RVA: 0x000818DF File Offset: 0x0007FADF
		// (set) Token: 0x060012BD RID: 4797 RVA: 0x000818EC File Offset: 0x0007FAEC
		public bool freezeRotation
		{
			get
			{
				return this._rigidbody.freezeRotation;
			}
			set
			{
				this._rigidbody.freezeRotation = value;
			}
		}

		// Token: 0x170002DA RID: 730
		// (get) Token: 0x060012BE RID: 4798 RVA: 0x000818FA File Offset: 0x0007FAFA
		// (set) Token: 0x060012BF RID: 4799 RVA: 0x00081907 File Offset: 0x0007FB07
		public float mass
		{
			get
			{
				return this._rigidbody.mass;
			}
			set
			{
				this._rigidbody.mass = value;
			}
		}

		// Token: 0x170002DB RID: 731
		// (get) Token: 0x060012C0 RID: 4800 RVA: 0x00081915 File Offset: 0x0007FB15
		// (set) Token: 0x060012C1 RID: 4801 RVA: 0x00081922 File Offset: 0x0007FB22
		public float maxAngularVelocity
		{
			get
			{
				return this._rigidbody.maxAngularVelocity;
			}
			set
			{
				this._rigidbody.maxAngularVelocity = value;
			}
		}

		// Token: 0x170002DC RID: 732
		// (get) Token: 0x060012C2 RID: 4802 RVA: 0x00081930 File Offset: 0x0007FB30
		// (set) Token: 0x060012C3 RID: 4803 RVA: 0x00081942 File Offset: 0x0007FB42
		public Vector3 position
		{
			get
			{
				return new Vector3(this._rigidbody.position);
			}
			set
			{
				this._rigidbody.position = value.vector3;
			}
		}

		// Token: 0x170002DD RID: 733
		// (get) Token: 0x060012C4 RID: 4804 RVA: 0x00081955 File Offset: 0x0007FB55
		// (set) Token: 0x060012C5 RID: 4805 RVA: 0x00081967 File Offset: 0x0007FB67
		public Quaternion rotation
		{
			get
			{
				return new Quaternion(this._rigidbody.rotation);
			}
			set
			{
				this._rigidbody.rotation = value.quaternion;
			}
		}

		// Token: 0x170002DE RID: 734
		// (get) Token: 0x060012C6 RID: 4806 RVA: 0x0008197C File Offset: 0x0007FB7C
		// (set) Token: 0x060012C7 RID: 4807 RVA: 0x000819D4 File Offset: 0x0007FBD4
		public bool useGravity
		{
			get
			{
				if (this._gravity == null)
				{
					this._gravity = this._rigidbody.GetComponent<Gravity>();
				}
				if (this._gravity != null)
				{
					return this._gravity.enabled;
				}
				return this._rigidbody.useGravity;
			}
			set
			{
				if (this._gravity == null)
				{
					this._gravity = this._rigidbody.GetComponent<Gravity>();
				}
				if (this._gravity != null)
				{
					this._gravity.enabled = value;
				}
				else
				{
					this._rigidbody.useGravity = value;
				}
			}
		}

		// Token: 0x170002DF RID: 735
		// (get) Token: 0x060012C8 RID: 4808 RVA: 0x00081A31 File Offset: 0x0007FC31
		// (set) Token: 0x060012C9 RID: 4809 RVA: 0x00081A43 File Offset: 0x0007FC43
		public Vector3 velocity
		{
			get
			{
				return new Vector3(this._rigidbody.velocity);
			}
			set
			{
				this._rigidbody.velocity = value.vector3;
			}
		}

		// Token: 0x170002E0 RID: 736
		// (get) Token: 0x060012CA RID: 4810 RVA: 0x00081A56 File Offset: 0x0007FC56
		public Vector3 worldCenterOfMass
		{
			get
			{
				return new Vector3(this._rigidbody.worldCenterOfMass);
			}
		}

		// Token: 0x170002E1 RID: 737
		// (get) Token: 0x060012CB RID: 4811 RVA: 0x00081A68 File Offset: 0x0007FC68
		// (set) Token: 0x060012CC RID: 4812 RVA: 0x00081A75 File Offset: 0x0007FC75
		public bool isKinematic
		{
			get
			{
				return this._rigidbody.isKinematic;
			}
			set
			{
				this._rigidbody.isKinematic = value;
			}
		}

		// Token: 0x060012CD RID: 4813 RVA: 0x00081A83 File Offset: 0x0007FC83
		public void AddExplosionForce(float explosionForce, Vector3 explosionPosition, float explosionRadius)
		{
			this._rigidbody.AddExplosionForce(explosionForce, explosionPosition.vector3, explosionRadius);
		}

		// Token: 0x060012CE RID: 4814 RVA: 0x00081A98 File Offset: 0x0007FC98
		public void AddForce(Vector3 force)
		{
			this._rigidbody.AddForce(force.vector3);
		}

		// Token: 0x060012CF RID: 4815 RVA: 0x00081AAB File Offset: 0x0007FCAB
		public void AddRelativeForce(Vector3 force)
		{
			this._rigidbody.AddRelativeForce(force.vector3);
		}

		// Token: 0x060012D0 RID: 4816 RVA: 0x00081ABE File Offset: 0x0007FCBE
		public void MovePosition(Vector3 position)
		{
			this._rigidbody.MovePosition(position.vector3);
		}

		// Token: 0x060012D1 RID: 4817 RVA: 0x00081AD1 File Offset: 0x0007FCD1
		public void MoveRotation(Quaternion rot)
		{
			this._rigidbody.MoveRotation(rot.quaternion);
		}

		// Token: 0x060012D2 RID: 4818 RVA: 0x00081AE4 File Offset: 0x0007FCE4
		public Vector3 ClosestPointOnBounds(Vector3 position)
		{
			return new Vector3(this._rigidbody.ClosestPointOnBounds(position.vector3));
		}

		// Token: 0x040016D5 RID: 5845
		private Rigidbody _rigidbody;

		// Token: 0x040016D6 RID: 5846
		private Gravity _gravity;
	}
}
